from django.contrib import admin
from .models import DailyTheme


@admin.register(DailyTheme)
class DailyThemeAdmin(admin.ModelAdmin):
    """每日主题管理"""
    list_display = ['id', 'title', 'theme_date', 'created_at']
    list_filter = ['theme_date', 'created_at']
    search_fields = ['title', 'description']
    readonly_fields = ['created_at']
    list_per_page = 20
    date_hierarchy = 'theme_date'
    
    fieldsets = [
        ('主题信息', {
            'fields': ['title', 'description', 'theme_date']
        }),
        ('时间信息', {
            'fields': ['created_at']
        }),
    ]
